package com.gitee.xmhzzz.component.spring.cloud.component.dao.dto;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gitee.xmhzzz.component.common.dto.PageBase;

/**
  * @ClassName
  * @Description
  * @Author wzq
  * @Date 2023/12/15 16:50
  * @Version 1.0
  */
public class PageBaseAdapter<T> extends Page<T> {
    /**
     * 分页查询对象转换
     *
     * @param pager 分页查询对象
     * @return 分页查询对象
     */
    public static <T> PageBaseAdapter<T> of(PageBase pager) {
        PageBaseAdapter<T> p = new PageBaseAdapter<>();
        p.setSize(pager.getSize());
        p.setCurrent(pager.getCurrent());
        return p;
    }
}
